package com.jiuqi.irs.generator.dao.pojo;

import java.io.Serializable;
import java.math.BigDecimal;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import com.jiuqi.common.DateUtil;
import com.jiuqi.irs.common.IrsConsts;

/** 
 *        @hibernate.class
 *         table="JK_LEDGER"
 *     
*/
public class JkLedger implements Serializable {

    /** identifier field */
    private String jlGuid;

    /** persistent field */
    private String proofId;

    /** nullable persistent field */
    private String ledgerState;

    /** nullable persistent field */
    private String proofCode;

    /** nullable persistent field */
    private String remitYear;

    /** nullable persistent field */
    private String remitMonth;

    /** nullable persistent field */
    private String remitDay;

    /** persistent field */
    private BigDecimal money;

    /** nullable persistent field */
    private String dealMan;

    /** nullable persistent field */
    private String ledgerTime;

    /** nullable persistent field */
    private String remark;

    /** persistent field */
    private String orgGuid;

    /** nullable persistent field */
    private String orgCode;

    /** nullable persistent field */
    private String orgTitle;

    /** nullable persistent field */
    private String reserved1;

    /** nullable persistent field */
    private String reserved2;

    /** nullable persistent field */
    private String reserved3;

    /** full constructor */
    public JkLedger(String jlGuid, String proofId, String ledgerState, String proofCode, String remitYear, String remitMonth, String remitDay, BigDecimal money, String dealMan, String ledgerTime, String remark, String orgGuid, String orgCode, String orgTitle, String reserved1, String reserved2, String reserved3) {
        this.jlGuid = jlGuid;
        this.proofId = proofId;
        this.ledgerState = ledgerState;
        this.proofCode = proofCode;
        this.remitYear = remitYear;
        this.remitMonth = remitMonth;
        this.remitDay = remitDay;
        this.money = money;
        this.dealMan = dealMan;
        this.ledgerTime = ledgerTime;
        this.remark = remark;
        this.orgGuid = orgGuid;
        this.orgCode = orgCode;
        this.orgTitle = orgTitle;
        this.reserved1 = reserved1;
        this.reserved2 = reserved2;
        this.reserved3 = reserved3;
    }

    /** default constructor */
    public JkLedger() {
    }

    /** minimal constructor */
    public JkLedger(String jlGuid, String proofId, BigDecimal money, String orgGuid) {
        this.jlGuid = jlGuid;
        this.proofId = proofId;
        this.money = money;
        this.orgGuid = orgGuid;
    }

    /** 
     *            @hibernate.id
     *             generator-class="assigned"
     *             type="java.lang.String"
     *             column="JL_GUID"
     *         
     */
    public String getJlGuid() {
        return this.jlGuid;
    }

    public void setJlGuid(String jlGuid) {
        this.jlGuid = jlGuid;
    }

    /** 
     *            @hibernate.property
     *             column="PROOF_ID"
     *             length="37"
     *             not-null="true"
     *         
     */
    public String getProofId() {
        return this.proofId;
    }

    public void setProofId(String proofId) {
        this.proofId = proofId;
    }

    /** 
     *            @hibernate.property
     *             column="LEDGER_STATE"
     *             length="2"
     *         
     */
    public String getLedgerState() {
        return this.ledgerState;
    }

    public void setLedgerState(String ledgerState) {
        this.ledgerState = ledgerState;
    }

    /** 
     *            @hibernate.property
     *             column="PROOF_CODE"
     *             length="20"
     *         
     */
    public String getProofCode() {
        return this.proofCode;
    }

    public void setProofCode(String proofCode) {
        this.proofCode = proofCode;
    }

    /** 
     *            @hibernate.property
     *             column="REMIT_YEAR"
     *             length="4"
     *         
     */
    public String getRemitYear() {
        return this.remitYear;
    }

    public void setRemitYear(String remitYear) {
        this.remitYear = remitYear;
    }

    /** 
     *            @hibernate.property
     *             column="REMIT_MONTH"
     *             length="2"
     *         
     */
    public String getRemitMonth() {
        return this.remitMonth;
    }

    public void setRemitMonth(String remitMonth) {
        this.remitMonth = remitMonth;
    }

    /** 
     *            @hibernate.property
     *             column="REMIT_DAY"
     *             length="2"
     *         
     */
    public String getRemitDay() {
        return this.remitDay;
    }

    public void setRemitDay(String remitDay) {
        this.remitDay = remitDay;
    }

    /** 
     *            @hibernate.property
     *             column="MONEY"
     *             length="20"
     *             not-null="true"
     *         
     */
    public BigDecimal getMoney() {
        return this.money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    /** 
     *            @hibernate.property
     *             column="DEAL_MAN"
     *             length="20"
     *         
     */
    public String getDealMan() {
        return this.dealMan;
    }

    public void setDealMan(String dealMan) {
        this.dealMan = dealMan;
    }

    /** 
     *            @hibernate.property
     *             column="LEDGER_TIME"
     *             length="14"
     *         
     */
    public String getLedgerTime() {
        return this.ledgerTime;
    }

    public void setLedgerTime(String ledgerTime) {
        this.ledgerTime = ledgerTime;
    }

    /** 
     *            @hibernate.property
     *             column="REMARK"
     *             length="200"
     *         
     */
    public String getRemark() {
        return this.remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    /** 
     *            @hibernate.property
     *             column="ORG_GUID"
     *             length="32"
     *             not-null="true"
     *         
     */
    public String getOrgGuid() {
        return this.orgGuid;
    }

    public void setOrgGuid(String orgGuid) {
        this.orgGuid = orgGuid;
    }

    /** 
     *            @hibernate.property
     *             column="ORG_CODE"
     *             length="42"
     *         
     */
    public String getOrgCode() {
        return this.orgCode;
    }

    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }

    /** 
     *            @hibernate.property
     *             column="ORG_TITLE"
     *             length="100"
     *         
     */
    public String getOrgTitle() {
        return this.orgTitle;
    }

    public void setOrgTitle(String orgTitle) {
        this.orgTitle = orgTitle;
    }

    /** 
     *            @hibernate.property
     *             column="RESERVED1"
     *             length="50"
     *         
     */
    public String getReserved1() {
        return this.reserved1;
    }

    public void setReserved1(String reserved1) {
        this.reserved1 = reserved1;
    }

    /** 
     *            @hibernate.property
     *             column="RESERVED2"
     *             length="100"
     *         
     */
    public String getReserved2() {
        return this.reserved2;
    }

    public void setReserved2(String reserved2) {
        this.reserved2 = reserved2;
    }

    /** 
     *            @hibernate.property
     *             column="RESERVED3"
     *             length="150"
     *         
     */
    public String getReserved3() {
        return this.reserved3;
    }

    public void setReserved3(String reserved3) {
        this.reserved3 = reserved3;
    }

    public String toString() {
        return new ToStringBuilder(this)
            .append("jlGuid", getJlGuid())
            .toString();
    }

    public boolean equals(Object other) {
        if ( !(other instanceof JkLedger) ) return false;
        JkLedger castOther = (JkLedger) other;
        return new EqualsBuilder()
            .append(this.getJlGuid(), castOther.getJlGuid())
            .isEquals();
    }

    public int hashCode() {
        return new HashCodeBuilder()
            .append(getJlGuid())
            .toHashCode();
    }
    /*********************************************************************************/
    public void doCheckIn(){
    	this.ledgerState = IrsConsts.ENUM_LEDGER_STATE_YDJ_KEY;
    	this.ledgerTime = DateUtil.getCurrentDateTimeString();
    }

}
